<?php

namespace App\Console\Commands;

use App\Console\BaseCommand;

class TestCastCommand extends BaseCommand
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'test:cast {json}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'test cast';

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handler()
    {
        // 接收参数
        $params = $this->getParams();
        // [可选] 开始执行时输出自定义提示
        $this->comment('start command : params :' . json_encode($params));

        // 逻辑代码
        // ...

        // [可选] 任务执行完毕时输出自定义提示
        $this->info('finished');

        return 1;
    }
}
